<%= startmapsetup %>

<%= begin showroute(@group.site.routes[@index]) rescue '' end %>
<%= preprunners(@runners) do |r| 
output = '<b>'+escape_javascript(h(r.first_name)+' '+h(r.last_name))+'</b><br/>'
output += 'Currently '+ r.distance_along_route.to_s + ' out of 26.2 miles'
end %>

<%= prepinc(@incentives) do |i|
	"<b>"+i.reward.to_s() +"</b><br/>" +image_for(i,:large).to_s()
end %>

loadmarks(marks,points,runnermarkers,incmarkers);
addmarkers(runnermarkers,map);
addmarkers(incmarkers,map);

<%= showlandmarks(@landmarks) {|l| landmarkdesc(l) } %>

<%= endroute %>
<%= endmapsetup %>

<%= link_to ('<< Previous Route ('+@group.runners_at(@index-1)+')', '?index='+(@index-1).to_s, :class => 'routebutton') if @index >0  %>
<%= link_to ('Next Route ('+@group.runners_at(@index+1)+') >> ','?index='+(@index+1).to_s, :class => 'routebutton') if @index+1 < @group.site.routes.length %>
<div id="map_canvas" style="width: 600px; height: 500px;"></div>
<%= button_to_function "Show/Hide Incentives", "togglemarkers(incmarkers);" %>
<%= button_to_function "Show/Hide Landmarks", "togglemarkers(landmarkmarkers);" %>
